package com.qeegoo.b2bautozityp.injector.module;

import android.support.v4.app.Fragment;

import com.cropper.imagepicker.ImagePicker;
import com.qeegoo.b2bautozityp.api.RequestApi;
import com.qeegoo.b2bautozityp.injector.PerFragment;
import com.qeegoo.b2bautozityp.moudle.good.viewmodel.GoodsBrandViewModel;
import com.qeegoo.b2bautozityp.moudle.good.viewmodel.GoodsInfoViewModel;
import com.qeegoo.b2bautozityp.moudle.good.viewmodel.GoodsPriceViewModel;
import com.qeegoo.b2bautozityp.moudle.good.viewmodel.GoodsPropertyViewModel;
import com.qeegoo.b2bautozityp.moudle.good.viewmodel.carmodel.CarModelAddViewModel;
import com.qeegoo.b2bautozityp.moudle.good.viewmodel.carmodel.CarModelOneViewModel;
import com.qeegoo.b2bautozityp.moudle.good.viewmodel.carmodel.CarModelSelectViewModel;
import com.qeegoo.b2bautozityp.moudle.good.viewmodel.carmodel.CarModelTwoViewModel;
import com.qeegoo.b2bautozityp.moudle.good.viewmodel.category.GoodsCategoryFragViewModel;
import com.qeegoo.b2bautozityp.rxbus.RxBus;

import dagger.Module;
import dagger.Provides;

/**
 * 王少岩 在 2017/9/13 创建了它
 */

@Module
public class GoodsFragmentModule {

    @Provides
    @PerFragment
    CarModelAddViewModel provideCarModelAddViewModel(Fragment fragment, RxBus rxBus, RequestApi requestApi) {
        return new CarModelAddViewModel(fragment, rxBus, requestApi);
    }

    @Provides
    @PerFragment
    CarModelOneViewModel provideCarModelOneViewModel(Fragment fragment, RequestApi requestApi) {
        return new CarModelOneViewModel(fragment, requestApi);
    }

    @Provides
    @PerFragment
    CarModelTwoViewModel provideCarModelTwoViewModel(Fragment fragment, RequestApi requestApi) {
        return new CarModelTwoViewModel(fragment, requestApi);
    }

    @Provides
    @PerFragment
    GoodsBrandViewModel provideGoodsBrandViewModel(RxBus rxBus, RequestApi requestApi) {
        return new GoodsBrandViewModel(rxBus, requestApi);
    }

    @Provides
    @PerFragment
    GoodsCategoryFragViewModel provideGoodsCategoryFragViewModel(Fragment fragment, RequestApi requestApi) {
        return new GoodsCategoryFragViewModel(fragment, requestApi);
    }

    @Provides
    @PerFragment
    GoodsInfoViewModel provideGoodsInfoViewModel(RequestApi requestApi) {
        return new GoodsInfoViewModel(requestApi);
    }

    @Provides
    @PerFragment
    GoodsPropertyViewModel provideGoodsPropertyViewModel(RequestApi requestApi) {
        return new GoodsPropertyViewModel(requestApi);
    }

    @Provides
    @PerFragment
    ImagePicker provideImgPicker() {
        ImagePicker imagePicker = new ImagePicker();
        imagePicker.setCropImage(false);
        return imagePicker;
    }

    @Provides
    @PerFragment
    GoodsPriceViewModel provideGoodsPriceViewModel(){
        return new GoodsPriceViewModel();
    }

    @Provides
    @PerFragment
    CarModelSelectViewModel provideCarModelSelectViewModel(){
        return new CarModelSelectViewModel();
    }

}
